/**
 * ======================================================
 * ForgetIT - Concise Preservation by combining Managed Forgetting and 
 * Contextualized Remembering 
 *                                                                                                     
 * FP7 EU Project that aims to improve preservation methods in digital space.
 * It combines three new concepts to ease the adoption of preservation in the
 * personal and organizational context, each overcoming major obstacles:
 * First, Managed Forgetting models resource selection as a function of attention
 * and significance dynamics. It is inspired by the important role of forgetting
 * in human memory and focuses on characteristic signals of reduction in salience.
 * For this purpose it relies on multi-faceted information assessment and offers
 * customizable preservation options such as full preservation, removing of 
 * redundancy, resource condensation, and also complete digital forgetting.
 * Secondly, Synergetic Preservation crosses the chasm that exists between active
 * information use and preservation management by making intelligent preservation 
 * processes an integral part of the content lifecycle in information management
 * and by developing solutions for smooth bi-directional transitions.
 * Thirdly, Contextualized Remembering targets keeping preserved content
 * meaningful and useful. It will be based on a process of dynamic evolution-aware
 * contextualization, which combines context extraction and packaging with 
 * evolution detection and intelligent re-contextualization.
 * 
 * To achieve these goals ForgetIT brings together an interdisciplinary team of 
 * experts in preservation, information management, information extraction, multimedia
 * analysis, personal information management, storage computing, and cloud computing,
 * as well as in cognitive psychology, law, and economics, who together will develop the
 * innovative methods for realizing the ForgetIT approach.
 * The main expected outcomes are the flexible Preserve-or-Forget Framework for 
 * intelligent preservation management and, on top of it, two application pilots: 
 * one for personal preservation focussing on multimedia coverage of personal events
 * and one for organizational preservation targeted at smooth preservation in
 * organizational content management. <br>
 * 
 * http://www.forgetit-project.eu * 
 * 
 * Copyright (c) 2009 - 2012 L3S Forschungszentrum
 * http://www.l3s.de
 * 
 * ======================================================
 * 
 * This module contains implementation source codes for
 * providing access services to the repository of users
 * and events which are located in L3S. It is part of 
 * the work package 3.
 *
 * The module is in alpha version, and subject to 
 * minor or partial changes during the integration phase (WP8),
 * upon requests and requirements among ForgetIT partners.
 *
 */
package de.l3s.forgetit.pimo;

import org.openrdf.model.Model;
import org.openrdf.model.Namespace;
import org.openrdf.model.ValueFactory;
import org.openrdf.model.impl.LinkedHashModel;
import org.openrdf.model.impl.NamespaceImpl;
import org.openrdf.model.impl.ValueFactoryImpl;
import org.openrdf.model.vocabulary.OWL;
import org.openrdf.model.vocabulary.RDF;
import org.openrdf.model.vocabulary.RDFS;
import de.l3s.forgetit.model.rdf.Ontology;

/**
 * This is just an example of an ontology that are generated from a PIMO script
 */
public class ThingOnto implements Ontology {
	
	private String name = "Thing";	
	private String prefix = "pimo:thing";
	private Namespace ns = new NamespaceImpl(prefix, prefix);
	private long versionId = 1383822238818l;
	
	/** Set of classes in the taxonomy, also the subclasses */
	public static final PIMOClass COUNTRY = new PIMOClass("pimo:thing#Country");
	public static final PIMOClass LOCATION = new PIMOClass("pimo:thing#Location");
	
	// ... other classes go here
	
	/** Set of properties in the taxonomy */
	public static final PIMOProperty manages = new PIMOProperty("pimo:thing#manages");
	public static final PIMOProperty does = new PIMOProperty("pimo:thing#does");
	public static final PIMOProperty isManagedBy = new PIMOProperty("pimo:thing#isManagedBy");
	
	// ... other properties go here
	
	/** Set of statements that makes up the model */
	private Model model;
	
	@Override
	public Model model() {
		if (model == null) {
			LinkedHashModel m = new LinkedHashModel();			
			ValueFactory f = ValueFactoryImpl.getInstance();			
			
			// define classes in RDF language
			m.add(f.createStatement(COUNTRY, RDF.TYPE, RDFS.CLASS));
			m.add(f.createStatement(LOCATION, RDF.TYPE, RDFS.CLASS));
			
			// define properties in RDF language
			m.add(f.createStatement(does, RDF.TYPE, RDF.PROPERTY));
			m.add(f.createStatement(manages, RDF.TYPE, RDF.PROPERTY));
			m.add(f.createStatement(isManagedBy, RDF.TYPE, RDF.PROPERTY));
			
			// define hierarchical taxonomy of classes and properties
			m.add(f.createStatement(COUNTRY, RDFS.SUBCLASSOF, LOCATION));
			m.add(f.createStatement(manages, RDFS.SUBPROPERTYOF, does));
			
			// define other kinds of statements
			m.add(f.createStatement(isManagedBy, OWL.INVERSEOF, manages));
			
			model = m;
		}
		return model;
	}

	@Override
	public long version() {
		return versionId;
	}
	
	@Override
	public String name() {
		return name;
	}
	
	@Override
	public String toString() {
		return name + "[" + versionId + "]";
	}

	@Override
	public Namespace namespace() {
		return ns;
	}
}

